package cn.dlc.com.utils;

import java.io.*;

/**
 * @author 邓立川
 * @date 2021/3/14 10:54
 * @desc 创建一个测试文本的工具类，在文件中生成100000-1的倒叙数据。reverse_arr.txt
 */
public class CreateData {

    public static void main(String[] args) throws Exception{
        String path = "F:\\mycode\\data-structure\\data-structure-demo01\\src\\main\\resources\\";
        File dir = new File(path);
        if(!dir.exists()) {
            // 创建目录
            dir.mkdirs();
        }

        File reverse_arr = new File(path + "reverse_arr.txt");

        FileWriter writer = new FileWriter(reverse_arr);

        for (int i =100000; i >=0 ;i--) {
            writer.write(i + "\n");
        }
        writer.flush();
        writer.close();
    }
}
